//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#include "../StatusStack.h"
#include "System/Base/Exceptions.h"

using namespace Native::Compiling;
using namespace Native::System;

CStatusStack::CStatusStack()
{
}

CStatusStack::CStatusStack(C_STATUS_STACK& that) :
    CObject(that),
    _status(that._status)
{
}

CStatusStack::CStatusStack(C_STATUS_STACK&& that) :
    CObject(that),
    _status(that._status)
{
}

CStatusStack::~CStatusStack()
{
}

void CStatusStack::Push(int32_t status)
{
    _status.push_back(status);
}

int32_t CStatusStack::Pop()
{
    if (_status.empty()) {
        return -1;
    } else {
        _status.pop_back();

        return _status[_status.size()-1];
    }
}

bool CStatusStack::Empty()
{
    return _status.empty();
}

void CStatusStack::Clear()
{
    return _status.clear();
}
